<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>商城产品页面</title>
    <link rel="stylesheet" type="text/css" href="${basePath }/public/css/common.css">
    <script type="text/javascript" src="${basePath }/public/js/laypage/laypage.js"></script>
    <script type="text/javascript" src="${basePath }/public/js/jquery.min.js"></script>
    <script type="text/javascript">
        function select() {
            var name = $("#a").val();
            window.location.href="${basePath}/home/homepage/like?name="+name;
        }
    </script>
</head>
<body>
<div class="top-header">
    <div class="section">
        <div class="top-header-left f-left">
            <a href="#">LOGO</a>
        </div>
        <div class="top-header-right f-right">
            <c:choose>
                <c:when test="${empty user}">
                    <a href="${basePath}/home/vipUser/toLogin">登录</a>
                    <a href="${basePath}/home/vipUser/toRegisterVip">注册</a>
                    <a href="${basePath}/admin/adminUser/toLogin">后台</a>
                </c:when>
                <c:otherwise>
                    <a href="#">欢迎你!<W style="color: bisque;font-weight: bold; font-family: 微软雅黑; font-size: 20px;">${user.username}</W></a>
                    <a href="${basePath}/admin/adminUser/toLogin">后台</a>
                    <a href="${basePath}/home/vipUser/write">注销</a>
                </c:otherwise>
            </c:choose>
        </div>
    </div>
</div>

<div class="section nav-header">
    <ul class="nav-menus f-left">
        <li><a href="${basePath}/home/homepage/index">首页</a></li>
        <li ><a href="${basePath}/home/homepage/toProductList"  class="active">产品列表</a></li>
        <li><a href="${basePath}/home/cart">购物车</a></li>
        <li><a href="${basePath}/home/vipUser/index" >会员中心</a></li>
        <li><a href="${basePath}/home/News/toNews">新闻资讯</a></li>
        <li><a href="${basePath}/home/pay/contact">联系我们</a></li>
    </ul>
    <div class="f-right nav-right">
        <input type="text" class="seacher-input f-left" placeholder="输入关键字">
        <a class="seacher-but  f-left" onclick="select()">搜索</a>
    </div>
</div>

<div class="section">
    <div class="screen-box">
        <!--分类-->
        <dl>
            <dt>分类：</dt>
            <dd>
                <a class="selected"  href="${basePath}/home/homepage/toProductList">全部</a>
                <a href="${basePath}/home/homepage/toProductList?catalogId=1">手机数码</a>
                <a href="${basePath}/home/homepage/toProductList?catalogId=2">电脑办公</a>
                <a href="${basePath}/home/homepage/toProductList?catalogId=3">影音娱乐</a>
            </dd>
        </dl>
        <!--/分类-->
        <!--价格-->
        <dl>
            <dt>价格：</dt>
            <dd>
                <a class="selected" href="${basePath}/home/homepage/toProductList">全部</a>
                <a href="${basePath}/home/homepage/toProductListPrice?min=0&max=100">0-100元</a>
                <a href="${basePath}/home/homepage/toProductListPrice?min=101&max=500">101-500元</a>
                <a href="${basePath}/home/homepage/toProductListPrice?min=501&max=1000">501-1000元</a>
                <a href="${basePath}/home/homepage/toProductListPrice?min=1001&max=2000">1001-2000元</a>
                <a href="${basePath}/home/homepage/toProductListPrice?min=2000&max=100000000">2000以上</a>
            </dd>
        </dl>
        <!--/价格-->
    </div>

    <div class="sort-box">
        <a class="first selected" href="${basePath}/home/homepage/toProductListDate">上架时间</a>
        <a href="${basePath}/home/homepage/toProductListClick">按人气</a>
        <a href="${basePath}/home/homepage/toProductListPriceDesc">价格从高到低</a>
        <a href="${basePath}/home/homepage/toProductListPriceAsc">价格从低到高</a>
    </div>
</div>


<div class="section" id="tbody">
    <ul class="img-list">
        <!--取得数据-->

        <!--分页页码-->
        <c:forEach items="${list}" var="m">
            <li>
                <a href="${basePath}/home/homepage/productDetail?id=${m.id}">
                    <div class="img-box">
                        <c:if test="${m.isHot eq 1}">
                            <div class="abs-txt">推荐</div>
                        </c:if>
                        <img src="${basePath }/public/images${m.goodsImg}">
                    </div>
                    <div class="info">
                        <h3>${m.goodsName}</h3>
                        <p class="price"><b>¥${m.sellPrice}</b>元</p>
                        <p>
                            <strong>库存 ${m.goodsNumber}</strong>
                            <span>市场价：<s>${m.marketPrice}</s></span>
                        </p>
                    </div>
                </a>
            </li>
        </c:forEach>
    </ul>
</div>

<div class="section qitian-main">
    <img src="${basePath}/public/images/qitian.png">
</div>

<div class="footer-copyright">
    <p>软信商城©2013-2017 软信大学版权所有 京ICP备17017089号 京公网安备11000002000006号</p>
</div>

</body>
</html>